/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pa165.pneu.pneuservisbackend.services;

import java.util.List;
import pa165.pneu.pneuservisbackend.to.ServicePneuTO;

/**
 *
 * @author Lukas Valkovic
 */
public interface ServicePneuService {
        
     /**
     * Method createService stores a new instace of service into db.
     * 
     * @param service to be stored
     * @throws IllegalArgumentException when id is not null
     */
    void createService(ServicePneuTO servicePneu);
    
    /**
     * Method getService returns object with given Id from db.
     * If none is found null is returned
     * 
     * @param id primary key of entity
     * @return service from db, null if doesn't exist
     * @throws IllegalArgumentException if id is null
     */
    ServicePneuTO getService(Long id);
    
    /**
     * Method updateService modifies existing objet in db.
     * 
     * @param servicePneu
     * @throws IllegalArgumentException if param is null, params id is null or 
     *              object with given id does not exist in db.
     */
    void updateService(ServicePneuTO servicePneu);
    
    /**
     * Method removeService will remove existing object from db.
     * 
     * @param servicePneu objet to be deleted from db
     * @throws IllegalArgumentException if param is null, params id is null or 
     *              object with given id does not exist in db.
     */
    void removeService(ServicePneuTO servicePneu);
    
    /**
     * Method getAllServices returns list of all services in db.
     * If table is empty, new empty list is returned.
     * 
     * @return list of all services 
     */
    List<ServicePneuTO> getAllServices();
    
    /**
     * Method findServiceWithName finds all services that have the given name.
     * 
     * @param name to be searched in db, not null
     * @return list of matched services
     * @throws IllegalArgumentException if name is null
     */
    List<ServicePneuTO> findServiceWithName(String name);
}
